package reflect;

import java.lang.reflect.Method;

/**
 * @author DBX
 * @effect 调用有参的方法
 * @date 2021/09/15/11:53
 */
public class ReflectDemo4 {
    public static void main(String[] args)throws Exception {
        User user = new User();
        user.say("大家好");

        Class cls = Class.forName("reflect.User");
        Object o = cls.newInstance();
        Method m = cls.getMethod("say", String.class);
        m.invoke(o,"sb");
    }
}
